package com.briup.app05.dao;

import com.briup.app05.bean.Article;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ArticleMapper {
    @Select("select * from cms_article")
    List<Article> selectAll();
    @Insert("insert into cms_article values(null,#{title},#{content},#{publish_date},#{read_times},#{thumb_up_times},#{thumb_down_times},#{status},#{category_id},#{user_id})")
    void insert(Article article);
    @Update("update cms_article set title=#{title},content=#{content},publish_date=#{publish_date},read_times=#{read_times},thumb_up_times=#{thumb_up_times},thumb_down_times=#{thumb_down_times},status=#{status},category_id=#{category_id},user_id=#{user_id} where id=#{id}")
    void  update(Article article);
    @Delete("delete from cms_article where id = #{id}")
    void  delete(Long id);
}
